package com.cskaoyan.bean.vo;

import com.cskaoyan.bean.BaseRespVo;
import lombok.Data;

/**
 * @author xudengfeng
 * @date 2020/12/7 17:05
 */
@Data
public class FileUploadVo<T> {
    long errno;
    T data;
    String errmsg;

    public static FileUploadVo ok() {
        FileUploadVo<Object> fileUploadVo = new FileUploadVo<>();
        fileUploadVo.setErrmsg("成功");
        fileUploadVo.setErrno(0);
        return fileUploadVo;
    }

    public static FileUploadVo ok(Object data) {
        FileUploadVo<Object> fileUploadVo = new FileUploadVo<>();
        fileUploadVo.setErrmsg("成功");
        fileUploadVo.setData(data);
        fileUploadVo.setErrno(0);
        return fileUploadVo;
    }

    public static FileUploadVo ok(Object data, String errmsg) {
        FileUploadVo<Object> fileUploadVo = new FileUploadVo<>();
        fileUploadVo.setErrno(0);
        fileUploadVo.setData(data);
        fileUploadVo.setErrmsg(errmsg);
        return fileUploadVo;
    }

    public static FileUploadVo fail() {
        FileUploadVo<Object> fileUploadVo = new FileUploadVo<>();
        fileUploadVo.setErrno(500);
        fileUploadVo.setErrmsg("失败");
        return fileUploadVo;
    }

    public static FileUploadVo fail(String errmsg) {
        FileUploadVo<Object> fileUploadVo = new FileUploadVo<>();
        fileUploadVo.setErrno(500);
        fileUploadVo.setErrmsg(errmsg);
        return fileUploadVo;
    }


}
